//
//  YKRefreshHeader.m
//  MagicBox
//
//  Created by wg on 16/9/7.
//  Copyright © 2016年 ZiLiFang. All rights reserved.
//

#import "YKRefreshHeader.h"
@interface YKRefreshHeader()
@property (nonatomic, strong) UIImageView *logoImg;
@property (nonatomic, strong) UILabel *label;

@end
@implementation YKRefreshHeader

/**
 *  初始化
 */
- (void)prepare
{
    [super prepare];
    
//    self.automaticallyChangeAlpha = YES;
//    self.lastUpdatedTimeLabel.hidden = YES;
//
//    
//    if (self.refreshHide) {
//        // 添加label
//        UILabel *label = [[UILabel alloc] init];
//        label.textColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0];
//        label.font = [UIFont boldSystemFontOfSize:16];
//        label.textAlignment = NSTextAlignmentCenter;
//        label.text = @"hello";
//        [self addSubview:label];
//        self.label = label;
//        return;
//    }
//    
//
    [self setTitle:@"下拉可以刷新" forState:MJRefreshStateIdle];
    [self setTitle:@"松开立即刷新" forState:MJRefreshStatePulling];
    [self setTitle:@"正在加载数据..." forState:MJRefreshStateRefreshing];

     //隐藏时间
    self.lastUpdatedTimeLabel.hidden = YES;
    self.stateLabel.font = [UIFont fontWithName:@"Helvetica" size:13.0f];
    self.stateLabel.textColor = [UIColor lightGrayColor];

    // 隐藏状态
//    self.stateLabel.hidden = YES;

//    // 设置普通状态的动画图片
//    NSMutableArray *idleImages = [NSMutableArray array];
//    for (NSUInteger i = 1; i<=40; i++) {
//        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%zd.png", i]];
//        [idleImages addObject:image];
//    }
//    [self setImages:idleImages forState:MJRefreshStateIdle];
//    
//    // 设置即将刷新状态的动画图片（一松开就会刷新的状态）
//    NSMutableArray *refreshingImages = [NSMutableArray array];
//    for (NSUInteger i = 1; i<=40; i++) {
//        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%zd", i]];
//        [refreshingImages addObject:image];
//    }
//    [self setImages:refreshingImages forState:MJRefreshStatePulling];
//    
//    // 设置正在刷新状态的动画图片
//    [self setImages:refreshingImages forState:MJRefreshStateRefreshing];

}


/**
 *  摆放子控件
 */
//- (void)placeSubviews
//{
//    [super placeSubviews];
//    
//    // 设置控件的高度
//    self.mj_h = 50;
//    self.label.frame = self.bounds;
//
//}
@end
